/*
 * @Description: 语言选择
 * @Version: 2.0
 * @Autor: lhl
 * @Date: 2021-08-21 19:30:02
 * @LastEditors: lhl
 * @LastEditTime: 2021-08-21 20:08:56
 */
import { getLocale } from "@/lang";
import { setLanguage } from "Utils/cookies";
export default {
  state: {
    langPicker: false,
    language: getLocale(),
  },
  mutations: {
    updateLanguage(state, language) {
      state.language = language;
      setLanguage(state.language);
    },
    toggleLangPicker(state, isShow) {
      state.langPicker = isShow;
    },
  },
  getters: {
    language: (state) => state.language,
    langPicker: (state) => state.langPicker,
  },
};
